package com.yiqi.liebang.feature.mine.view.adapter;

import android.graphics.Paint;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.utils.DateUtil;
import com.yiqi.liebang.R;
import com.yiqi.liebang.common.util.DateTool;
import com.yiqi.liebang.common.widget.RatingBar;
import com.yiqi.liebang.entity.bo.QuestionBo;
import com.yiqi.liebang.entity.bo.UserCenterBo;

public class TopicAdapter extends BaseQuickAdapter<UserCenterBo.TopicBean, BaseViewHolder> {

    boolean isShow=false;boolean isLookMe=false;
    public TopicAdapter(boolean isShow,boolean isLookMe) {
        super(R.layout.item_userinfo_topic);
        this.isShow=isShow;
        this.isLookMe=isLookMe;
    }

    @Override
    protected void convert(BaseViewHolder helper, UserCenterBo.TopicBean item) {
        TextView textView = helper.getView(R.id.tv_user_topic_prize_yuan);
        textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
        helper.setText(R.id.tv_user_topic_title, item.getTopicName())
                .setText(R.id.tv_user_topic_num, "帮助过" + item.getHelpNum() + "人")
                .setText(R.id.tv_user_topic_time, item.getServiceTime() + "小时/次")
                .setText(R.id.tv_user_topic_prize, item.getTopicPrice() + "")
                .setText(R.id.tv_user_topic_prize_yuan, item.getOriginalPrice() + "元/次")
                .setText(R.id.tv_user_topic_type, item.getServiceType() == 0 ? "线下约见" : "全国通话")
                .setBackgroundRes(R.id.tv_user_topic_type, item.getServiceType() == 0 ? R.drawable.list_button_xianxia : R.drawable.list_button_quanguo)
        ;
        RatingBar ratingBar = helper.getView(R.id.rb_user_topic_star);
        ratingBar.setStar(2.5f);
    }
}
